import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            redirect: '/home',
        },
        {
            path: '/home',
            component: () => import('../src/home.vue'),
            name: 'home',

        }, {
            path: '/category',
            component: () => import('../src/category.vue'),
            name: 'category',

        }, {
            path: '/message',
            component: () => import('../src/message.vue'),
            name: 'message',
        }, {
            path: '/cart',
            component: () => import('../src/cart.vue'),
            name: 'cart',
        },
        {
            path: '/user',
            component: () => import('../src/User.vue'),
            name: 'user',
        },
        {
            path: '/GoodsList/:category_id',
            component: () => import('../src/GoodsList.vue'),
            name: 'GoodsList',
            props: true,
        },
        {
            path: '/detailed/:id',
            component: () => import('../src/detailed.vue'),
            name: 'detailed',
            props: true,
        },
        {
            path: '/login',
            component: () => import('../components/login.vue'),
            name: 'login',
        },
        {
            path: '/register',
            component: () => import('../components/register.vue'),
            name: 'register',
        }
    ]
})

export default router